package script.db

databaseChangeLog(logicalFilePath: 'script/db/hpfm_cusz_config_field_wdg_tl.groovy') {
    changeSet(author: "hzero@hand-china.com", id: "2022-04-25-hpfm_cusz_config_field_wdg_tl") {
        def weight = 1
        if (helper.isSqlServer()) {
            weight = 2
        } else if (helper.isOracle()) {
            weight = 3
        }
        createTable(tableName: "hpfm_cusz_config_field_wdg_tl", remarks: "个性化扩展字段多语言") {
            column(name: "id", type: "bigint", remarks: "") { constraints(nullable: "false") }
            column(name: "lang", type: "varchar(" + 30 * weight + ")", remarks: "") { constraints(nullable: "false") }
            column(name: "default_value", type: "longtext", remarks: "")
            column(name: "placeholder", type: "varchar(" + 225 * weight + ")", remarks: "")
            column(name: "help", type: "varchar(" + 255 * weight + ")", remarks: "")
            column(name: "tenant_id", type: "bigint", remarks: "") { constraints(nullable: "false") }
        }


        addUniqueConstraint(columnNames: "id,lang", tableName: "hpfm_cusz_config_field_wdg_tl", constraintName: "hpfm_cusz_cfg_field_wdg_tl_u1")
    }
}